﻿<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="QuickDeployEnhancements.QuickDeployInitiate, QuickDeployEnhancements,Version=1.0.0.0,Culture=neutral,PublicKeyToken=0ade166f09b33351" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<asp:Content ID="PageTitle" runat="server" contentplaceholderid="PlaceHolderPageTitle">
    Starting Quick Deploy Job...
</asp:Content>

<asp:Content ID="PlaceHolderPageTitleInTitleArea" runat="server" contentplaceholderid="PlaceHolderPageTitleInTitleArea">
    Starting Quick Deploy Job...
</asp:Content>

<asp:Content ID="Main" runat="server" contentplaceholderid="PlaceHolderMain" >
        <SharePoint:FormDigest runat="server"/>
        In the following table the Quick Deploy Jobs for the current Site Collection are listed.<br />
        <ul>
            <li>Choose "Start Job" to manually initiate that specific Quick Deploy Job.</li>
            <li>Choose "Clear" to remove the Quick Deploy Objects for that specific Quick Deploy Job. Removing Quick Deploy Objects may help in fixing problems with Quick Deploy.</li>
        </ul>
        <asp:Label runat="server" ID="errormessage" CssClass="ms-alerttext"/>
        <asp:Repeater runat="server" ID="JobRepeater">
            <HeaderTemplate>    
                <table class="ms-menutoolbar" width="100%">
                    <tr>                        
                        <td class="ms-toolbar" width="100%" noWrap="noWrap"></td>
                    </tr>
                </table>
                <table class="ms-listviewtable" width="100%" cellpadding="0" cellspacing="0">
                    <tr class="ms-viewheadertr">
                        <th class="ms-vh2">Enabled</th>
                        <th class="ms-vh2">Job name</th>
                        <th class="ms-vh2">Last status</th>
                        <th class="ms-vh2">Last run</th>
                        <th class="ms-vh2">Next run</th>
                        <th class="ms-vh2">Itemcount</th>
                        <th class="ms-vh2">Actions</th>
                    </tr>
            </HeaderTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
            <ItemTemplate>
                <tr>
                    <td class="ms-vb2">
                        <asp:CheckBox runat="server" Enabled="false" Checked='<%# DataBinder.Eval(Container.DataItem, "IsEnabled") %>' />
                    </td>
                    <td class="ms-vb2">
                        <asp:Label runat="server">
                            <%# DataBinder.Eval(Container.DataItem, "Name") %>
                        </asp:Label> 
                    </td>
                    <td class="ms-vb2">
                        <b><asp:Label runat="server">
                            <%# DataBinder.Eval(Container.DataItem, "LastStatus")%>
                        </asp:Label></b>
                    </td>
                    <td class="ms-vb2">
                        <asp:Label runat="server">
                            <%# DataBinder.Eval(Container.DataItem, "LastRunTime") %>
                        </asp:Label> <br />
                        <asp:Label runat="server">
                            <%# DataBinder.Eval(Container.DataItem, "LastRunStatusMessage")%>
                        </asp:Label>                        
                    </td>
                    <td class="ms-vb2">
                        <asp:Label runat="server">
                            <%# DataBinder.Eval(Container.DataItem, "NextRunTime") %>
                        </asp:Label>
                    </td>
                    <td class="ms-vb2">
                        <asp:Label runat="server">
                            <%# DataBinder.Eval(Container.DataItem, "QuickDeployItems") %>
                        </asp:Label>
                    </td>
                    <td class="ms-vb2" NOWRAP="NOWRAP">
                        <asp:Button runat="server" Text="Start Job" OnClick="Start_Click" />
                        <asp:Button runat="server" Text="Clear" OnClick="Clear_Click" />
                    </td>
                </tr>
            </ItemTemplate>
            <SeparatorTemplate>
                <tr>
                    <td colspan="4"><hr /></td>
                </tr>
            </SeparatorTemplate>
        </asp:Repeater>
        
        <script language="javascript" type="text/javascript">
            setTimeout("refresh()", 10 * 1000);

            function refresh() {
                window.location.href = window.location.href;
            }

        </script>
</asp:Content>